<?php

namespace Apps\Common\Models;

/**
 * 搜索的数据源Model
 * @author     chenxiaolin
 * @date        2016年1月19日
 * @version     2.0.0
 * @copyright   Copyright 2016 meelier.com
 */
class OpenSearchSource extends \PhalconPlus\Database\Model
{

    /**
     *
     * @var string
     */
    public $id;

    /**
     *
     * @var integer
     */
    public $info_type;

    /**
     *
     * @var string
     */
    public $info_id;

    /**
     *
     * @var string
     */
    public $info_tag_int;

    /**
     *
     * @var string
     */
    public $info_tag_str;

    /**
     *
     * @var string
     */
    public $info_show_data;

    /**
     *
     * @var string
     */
    public $search_title;

    /**
     *
     * @var string
     */
    public $search_content;

    /**
     *
     * @var integer
     */
    public $sync_state;

    /**
     *
     * @var string
     */
    public $sync_time;

    /**
     * Returns table name mapped in the model.
     *
     * @return string
     */
    public function getSource()
    {
        return 'open_search_source';
    }

    /**
     * Allows to query a set of records that match the specified conditions
     *
     * @param mixed $parameters
     * @return OpenSearchSource[]
     */
    public static function find($parameters = null)
    {
        return parent::find($parameters);
    }

    /**
     * Allows to query the first record that match the specified conditions
     *
     * @param mixed $parameters
     * @return OpenSearchSource
     */
    public static function findFirst($parameters = null)
    {
        return parent::findFirst($parameters);
    }

    /**
     * Independent Column Mapping.
     * Keys are the real names in the table and the values their names in the application
     *
     * @return array
     */
    public function columnMap()
    {
        return array(
            'id' => 'id',
            'info_type' => 'info_type',
            'info_id' => 'info_id',
            'info_tag_int' => 'info_tag_int',
            'info_tag_str' => 'info_tag_str',
            'info_show_data' => 'info_show_data',
            'search_title' => 'search_title',
            'search_content' => 'search_content',
            'sync_state' => 'sync_state',
            'sync_time' => 'sync_time'
        );
    }

    public function defaultColumns()
    {
        return [
            'sync_state',
            'sync_time'
        ];
    }

}
